{% extends 'index.html' %}
{% block main-content %}
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title">课室管理</h3>
        </div>

    </div>
    <br>
    <form class="col-md-11" style="width: 100%;margin-top: 20px;left: 30px" method="post">
        <div class="form-group form-inline">
            <label for="course_select">课&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;程</label>&nbsp;
            <select name="course_select" id="course_select" class="form-control" style="width:150px;height: 50px">
                <option value="" selected>请选择课程名称</option>
                {% for keshi02_obj in keshi_queryset %}
                    {% if keshi02_obj.coursename %}
                        <option value="{{ keshi02_obj.coursename }}" selected>{{ keshi02_obj.coursename }}</option>
                    {% else %}
                        <option value="{{ keshi02_obj.coursename }}">{{ keshi02_obj.coursename }}</option>
                    {% endif %}
                {% endfor %}
            </select>&nbsp;&nbsp;
            <label for="class_select">课&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;室</label>&nbsp;
            <select name="class_select" id="class_select" class="form-control" style="width:150px;height: 50px">
                <option value="" selected>请选择课室名称</option>
                {% for keshi02_obj in keshi_queryset %}
                    {% if keshi02_obj.classroomnum %}
                        <option value="{{ keshi02_obj.classroomnum }}" selected>{{ keshi02_obj.classroomnum }}</option>
                    {% else %}
                        <option value="{{ keshi02_obj.classroomnum }}">{{ keshi02_obj.classroomnum }}</option>
                    {% endif %}
                {% endfor %}
            </select>&nbsp;&nbsp;
            <label for="studentnum">学生人数</label>&nbsp;
            <input type="text" class="form-control" id="studentnum" placeholder="输入学生人数" style="width:150px;height: 50px"
                   disabled name="studentnum" value="{{ keshi_obj.studentnum }}">&nbsp;&nbsp;
            <label for="seatsnum">座位总数</label>&nbsp;
            <input type="text" class="form-control" id="seatsnum" placeholder="座位自动计算" style="width:150px;height: 50px"
                   disabled name="seatsnum" value="{{ keshi_obj.seatnum }}">
            <label for="btn_create">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
            <button type="submit" class="btn btn-success" id="btn_kq" style="width: 130px;height: 50px" name="">开始考勤
            </button>&nbsp;&nbsp;
        </div>
    <div class="form-group form-inline">
            <label for="qiandaonum">已签到人数</label>&nbsp;
            <input type="text" class="form-control" id="qiandaonum" placeholder="人数自动计算" style="width:150px;height: 50px"
               disabled     name="qiandaonum" value="{{ yidaonum }}">&nbsp;&nbsp;
            <label for="weidaosnum">未签到人数</label>&nbsp;
            <input type="text" class="form-control" id="weidaosnum" placeholder="人数自动计算" style="width:150px;height: 50px"
               disabled     name="weidaosnum" value="{{ weidaonum }}">
                    <label for="qingjiasnum">请假人数</label>&nbsp;
            <input type="text" class="form-control" id="qingjiasnum" placeholder="人数自动计算" style="width:150px;height: 50px"
               disabled     name="qingjiasnum" value="{{ qingjianum }}">
        </div>
        <br>
    </form>
    <br><br>
       <div class="panel panel-primary" style="clear: both">
        <div class="panel-heading">
            <h3 class="panel-title">课室查看</h3>
        </div>
    </div>
    <div class="form-group" style="height: 100%;width: 100%;background-color: #bfcbd9">
    <div style="background-color:#304156;font-size: 50px;height: 68px;width:100px;margin-left:45%">讲台</div>
    </div>
    <div class="form-group" style="height: 30px;width: 100%;background-color: #bfcbd9"></div>
    {% load static %}
    <div class="panel panel-info">

            <div class="col-md-12">
                {% for re in list1 %}
                    <a href="" data-toggle="modal" data-target=".bs-example-modal-lg"><button style='width:180px;height:160px;margin:5px 5px;background-color: #f6f4ec'>
                        <div class="caption">
                            <img src="{% static 'img/devices.png' %}" alt="" id="{{ re }}"
                                 style='width:130px;height:90px'>
                            <p id="{{ re }}-" style="margin-top: 3px"></p>
                            <p >当前座位:{{ re|safe }}</p>
                        </div>
                    </button></a>&nbsp;&nbsp;
                {% endfor %}
                <script>
                    {% for re1 in kaoqin_obj %}
                        $('#{{re1.seatcoordinates}}').attr("src", "{{re1.avatar}}");
                        $('#{{re1.seatcoordinates}}-').text('学号:{{ re1.stunum }}');
                    {% endfor %}
                </script>
            </div>

    </div>
    <script>
        $('#btn_kq').click(function () {
            $.ajax({
                url: '/tea_admin/classmanage/',
                type: 'post',
                data: {
                    "class_select": $('#class_select').val(),
                    "course_select": $('#course_select').val()
                },
                success: function (args) {

                }
            })
        })
    </script>
    <div class="modal fade " tabindex="-1" role="dialog"
     aria-labelledby="myLargeModalLabel">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <form action="" method="post">
                <h1 class="text-center">密码</h1>
                <div class="row">
                    <div class="col-md-8 col-md-offset-2">
                        <div class="form-group">
                            <label for="username">用户名</label>
                            <input type="text" name="username" id="username" value="{{ user_obj.teaname }}" disabled>
                        </div>
                        <div class="form-group">
                            <label for="id_old_password">原密码:</label>
                            <input type="password" id="id_old_password" name="old_name"
                                   class="form-control">
                        </div>
                        <div class="form-group">
                            <label for="id_new_password">新密码:</label>
                            <input type="password" id="id_new_password" name="new_name"
                                   class="form-control">
                        </div>
                        <div class="form-group">
                            <label for="id_confirm_password">确认密码:</label>
                            <input type="password" id="id_confirm_password" name="confirm_name"
                                   class="form-control">
                        </div>
                        <button type="button" class="btn btn-default pull-right"
                                data-dismiss="modal">Close
                        </button>
                        <button class="btn btn-primary" id="id_edit">修改</button>
                        <br>
                        <br>
            </form>
        </div>
    </div>
</div>
{% endblock %}